const DEV_CODE_KEY = "Dev-Code";
import tools from './tools.js';
export default class DevInfo {
	static getDevInfo() {
		
		let info = {
			devCode: this.getDevCode(),
			devType: this.getDevType()
		};

		return info;
	}
	
	static getDevCode(){
		let devCode ="";
		//#ifdef APP-PLUS || APP-PLUS-NVUE
		devCode=plus.device.uuid;
		//#endif
		if(devCode===""){
			devCode = uni.getStorageSync(DEV_CODE_KEY);
			if (!devCode || devCode == '') {
				devCode = tools.uuid(16, 16);
				uni.setStorageSync(DEV_CODE_KEY, devCode);
			}
		}
		
		return devCode;
	}

	static getDevType() {
		let devType = '';
		//#ifdef APP-PLUS || APP-PLUS-NVUE
		devType = uni.getSystemInfoSync().platform;
		//#endif

		//#ifdef H5
		devType = "H5";
		//#endif

		//#ifdef MP
		devType = "MP";
		//#endif
		return devType;
	}
}
